package com.puntodonna.fogliocassa.client.app.presenter.header;

import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.ViewImpl;
import com.puntodonna.fogliocassa.shared.UserObj;

public class HeaderView extends ViewImpl implements HeaderPresenter.MyView {

	private final Widget widget;

	public interface Binder extends UiBinder<Widget, HeaderView> {
	}

	@UiField
	protected Label userInfo;

	@UiField
	protected Label logoutLabel;
	
	@UiField
	protected HorizontalPanel infoPanel;
	
	protected UserObj userObj;

	@Inject
	public HeaderView(final Binder binder) {
		widget = binder.createAndBindUi(this);
	}

	@Override
	public Widget asWidget() {
		return widget;
	}

	protected Label getUserInfo() {
		return userInfo;
	}
	
	public Label getLogoutLabel() {
		return logoutLabel;
	}
	
	public HorizontalPanel getInfoPanel() {
		return infoPanel;
	}

	public void setUserInfo(String userInfo) {
		getUserInfo().setText(userInfo);
	}
}
